package com.ailesson.user.controller;


import com.ailesson.user.service.UserInfoService;
import com.ailesson.common.reply.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/user")
public class UserLoginController {

    @Autowired
    private UserInfoService userInfoService;


    @PostMapping("/login")
    public R login() {
        //{"code":20000,"data":{"token":"admin-token"}}
        Map<String,Object> map = new HashMap<>();
        map.put("token","admin-token");
        return R.success(map);
    }

    //info
    @GetMapping("/info")
    public R info() {
        Map<String,Object> map = new HashMap<>();
        map.put("roles","admin");
        map.put("introduction","I am a super administrator");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        map.put("name","Super Admin");
        return R.success(map);
    }

    @PostMapping("/logout")
    public R logout() {
        return R.success();
    }

}
